package com.trivia

class AppUserService {

    static transactional = true

    def authenticate(Long userId) {
        
		AppUser appUser = AppUser.get(userId)

        if(appUser == null){
			appUser = new AppUser()
            appUser.id = userId
            appUser.save()
         }
         
		 return appUser
    }
}
